#!/usr/bin/python
# vim:fileencoding=utf8

import unittest
import thought
import english_text_2_thought
from gnTai.knowledge import language

class TestThought(unittest.TestCase):
    def test_dict(self):
        self.assert_(language.gnt_knowledge.is_part_of_speech('the', 'article'))
        self.assert_(language.gnt_knowledge.is_part_of_speech('love', 'noun'))
        self.assert_(language.gnt_knowledge.is_part_of_speech('love', 'verb'))
        self.assert_(language.gnt_knowledge.is_part_of_speech('human', 'noun'))
        love = language.gnt_knowledge.get_part_of_speech('love', 'noun')
        self.assertEqual(love.get_string(plurum=True, common=False), "loves'")
        exist = language.gnt_knowledge.get_part_of_speech('exist', 'verb')
        self.assertEqual(exist.get_string(plurum=False, person=3), "exists")
        
    def test_repeating(self):
        test = english_text_2_thought.EnglishText2Thought(language.test_knowledge)
        self.assertEqual(str(test.statement2thought("The apple does not do.")),
                         "The apple does not do.")
        self.assertEqual(test.statement2thought("The apple does not do."),
                         "The apple does not do.")

class TestEnglishGrammar(unittest.TestCase):
    def test_grammar_generation(self):
        pass


def suite():
    suite = unittest.TestSuite()
    suite.addTest(TestThought('test_dict'))
    suite.addTest(TestThought('test_repeating'))
    return suite


if __name__ == "__main__":
    unittest.main()
